public class Test {
    //循环
    public static int getAge1(int person){
        int age = 10;
        for (int i = 0; i < person-1; i++) {
            age += 2;
        }
        return age;
    }
    //递归
    public static int getAge(int person){
        if(person == 1) {
            return 10;
        }
        return getAge(person - 1) + 2;
    }
    
    public static void main(String[] args) {
        System.out.println(getAge(5));
    }
}
